﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Maps.MapControl;

namespace TelecoSystems.Modules.Customers.Views
{
    public partial class MapView : ChildWindow
    {
        public MapView(double latitude, double longtitude, string label, string address)
        {            
            InitializeComponent();

            Pushpin pushpin = new Pushpin();
            pushpin.Template = this.Resources["PushpinTemplate"] as ControlTemplate;
            pushpin.Width = 150;
            pushpin.Height = 35;
            pushpin.Content = label;
            pushpin.Tag = address;
            MapLayer layer = new MapLayer();
            layer.AddChild(pushpin, new Location(latitude, longtitude));

            MiniMap.Children.Add(layer);

            MiniMap.AnimationLevel = AnimationLevel.Full;
            MiniMap.SetView(new Location(latitude, longtitude), 14);
        }

        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {            
            this.DialogResult = false;
        }
    }
}

